package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

@Data
public class LeaseException extends RuntimeException {

    private ResultCodeEnum resultCodeEnum;
    //new的时候可以传一个message
    public LeaseException(String message) {
        super(message);
    }
    //new的时候可以传一个resultCodeEnum,里面包含message以及枚举.
    public LeaseException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.resultCodeEnum = resultCodeEnum;
    }

}
